#pragma once

#include <memory>
#include <functional>

class Buffer;
class TcpConnection;
class Timestamp;

using TcpConnectionPtr = std::shared_ptr<TcpConnection>;  // 指向TcpConnection对象的智能指针

// 定义回调函数类型

using ConnectionCallback = std::function<void(const TcpConnectionPtr& conn)>;  // 连接建立、断开的回调
using CloseCallback = std::function<void(const TcpConnectionPtr& conn)>;
using WriteCompleteCallback = std::function<void(const TcpConnectionPtr& conn)>;  // 消息发送完成后的回调
using MessageCallback = std::function<void(const TcpConnectionPtr& conn, Buffer* buf, Timestamp receiveTime)>;  // 有读写消息时的回调，第三个参数是读取数据的时间点
using HighWaterMarkCallback = std::function<void(const TcpConnectionPtr& conn, size_t highWaterMark)>;  // 高水位回调